/*    */ package com.wgcloud.common;
/*    */ 
/*    */ import com.wgcloud.common.NettyServerInitializer;
/*    */ import io.netty.bootstrap.ServerBootstrap;
/*    */ import io.netty.channel.ChannelFuture;
/*    */ import io.netty.channel.ChannelHandler;
/*    */ import io.netty.channel.EventLoopGroup;
/*    */ import io.netty.channel.nio.NioEventLoopGroup;
/*    */ import io.netty.channel.socket.nio.NioServerSocketChannel;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class NettyServer
/*    */ {
/*    */   public static void start(int port) throws InterruptedException {
/* 21 */     NioEventLoopGroup nioEventLoopGroup1 = new NioEventLoopGroup();
/*    */     
/* 23 */     NioEventLoopGroup nioEventLoopGroup2 = new NioEventLoopGroup();
/*    */     
/*    */     try {
/* 26 */       ServerBootstrap serverBootstrap = new ServerBootstrap();
/* 27 */       ((ServerBootstrap)serverBootstrap.group((EventLoopGroup)nioEventLoopGroup1, (EventLoopGroup)nioEventLoopGroup2)
/* 28 */         .channel(NioServerSocketChannel.class))
/* 29 */         .childHandler((ChannelHandler)new NettyServerInitializer());
/*    */       
/* 31 */       ChannelFuture channelFuture = serverBootstrap.bind(port).sync();
/*    */       
/* 33 */       channelFuture.channel().closeFuture().sync();
/*    */     } finally {
/* 35 */       nioEventLoopGroup1.shutdownGracefully();
/* 36 */       nioEventLoopGroup2.shutdownGracefully();
/*    */     } 
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/common/NettyServer.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */